﻿using Core.Infrastructure;
using System.Web.Mvc;
using System.Web.Routing;

namespace Net.Web.Controllers
{
    /// <summary>
    /// 基本控制器
    /// </summary>
    public class BaseController : Controller
    {
        protected virtual ActionResult InvokeHttp404()
        {
            // Call target Controller and pass the routeData.
            IController errorController = EngineContext.Current.Resolve<Net.Web.Controllers.CommonController>();

            var routeData = new RouteData();
            routeData.Values.Add("controller", "Common");
            routeData.Values.Add("action", "PageNotFound");

            errorController.Execute(new RequestContext(this.HttpContext, routeData));

            return new EmptyResult();
        }
    }
}